package com.foreknow.service.impl;

import com.foreknow.dao.ConstantitemMapper;
import com.foreknow.entity.Constantitem;
import com.foreknow.service.ConstantitemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class ConstantitemServiceImpl implements ConstantitemService {

    @Autowired
    private ConstantitemMapper constantitemMapper;
    @Override
    public int deleteByPrimaryKey(Integer id) {
        return 0;
    }

    @Override
    public int insert(Constantitem record) {
        return 0;
    }

    @Override
    public Constantitem selectByPrimaryKey(Integer id) {
        return constantitemMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Constantitem> selectByConstantTypeID(Integer id) {
        return constantitemMapper.selectByConstantTypeID(id);
    }



    @Override
    public int updateByPrimaryKey(Constantitem record) {
        return 0;
    }

    /**
     * 根据id删除
     *
     * @param id
     * @return
     */
    @Override
    public int updateConstantitemByDelmark(Integer id) {
        return constantitemMapper.updateConstantitemByDelmark(id);
    }

    /**
     * 添加
     *
     * @param constantitem
     * @return
     */
    @Override
    public int save(Constantitem constantitem) {
        return  constantitemMapper.save(constantitem);
    }




    /**
     * 根据record更新
     *
     * @param record
     * @return
     */
    @Override
    public int updateByPrimaryKeySelective(Constantitem record) {
        return constantitemMapper.updateById(record);
    }

    /**
     * 查询所有
     * (逻辑删除 通过delmark的值查询所有 默认1存在 0删除)
     *
     * @return
     */
    @Override
    public List<Constantitem> findAll() {
        return constantitemMapper.findAll();
    }

    /**
     * 根据ConstantTypeID查询显示constantitem对象
     *
     * @param ConstantTypeID
     * @return
     */
    @Override
    public List<Constantitem> selectByTypeID(Integer ConstantTypeID) {
        return constantitemMapper.selectByTypeID(ConstantTypeID);
    }

}
